﻿// JScript 文件
function IsEmpty(text,message)
{
    if(text.value.trim().length==0)
    {
        alert(message);
        text.select();
        return false;
    }
    return true;
}
function checkJianyi(text) 
{
    //标题大于10位数
    if (text.value.length>10)
    {
        alert('标题字数不能超过10个');
        text.select();  
        return false;
    }
    return true;
}
//打开窗口
function openWin(f,n,w,h,s)
{
	    sb = s == "1" ? "1" : "0";
	    l = (screen.width - w)/2;
	    t = (screen.height - h)/2;
	    sFeatures = "left="+ l +",top="+ t +",height="+ h +",width="+ w
			    + ",center=1,scrollbars=" + sb + ",status=0,directories=0,channelmode=0";
	    openwin = window.open(f , n , sFeatures );
	    if (!openwin.opener)
		    openwin.opener = self;
	    openwin.focus();
	//return openwin;
}
function IsJianyi()
{
   if( IsEmpty(document.getElementById("Title"),'标题为必填项不能为空！')==true && checkJianyi(document.getElementById("Title"))==true  &&  IsEmpty(document.getElementById("Content"),'内容不能为空！')==true )
     {
        return true;
    }
    return false;
}